﻿@model Arms.Presentation.Web.Areas.Orders.Models.OrderViewModel

@{
    ViewBag.Title = "View Order";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="action-nav-normal action-nav-line">
    <div class="row action-nav-row">
        <div class="col-sm-2 action-nav-button">
            <a href="@Url.Action("Invoice", "Order", new { area = "Orders", orderHeaderID = Model.OrderHeader.OrderHeaderID })" title="New Project">
                <i class="icon-file-alt"></i>
                <span>Complete Order Header</span>
            </a>
            <span class="triangle-button green"><i class="icon-ok"></i></span>
        </div>

        <div class="col-sm-2 action-nav-button">
            <a href="@Url.Action("Void", "Order", new { area = "Orders", orderHeaderID = Model.OrderHeader.OrderHeaderID })" title="Void Order">
                <i class="icon-file-alt"></i>
                <span>Void Order Header</span>
            </a>
            <span class="triangle-button red"><i class="icon-remove"></i></span>
        </div>

        <div class="col-sm-2 action-nav-button">
            <a href="@Url.Action("Invoice", "Order", new { area = "Orders", orderHeaderID = Model.OrderHeader.OrderHeaderID })" title="Add Order">
                <i class="icon-folder-open-alt"></i>
                <span>Add Order</span>
            </a>
            <span class="triangle-button green"><i class="icon-plus"></i></span>
        </div>
    </div>
</div>
<div class="box">
    <div class="box-header">
        <div class="title">Order Info</div>
    </div>
    <div class="box-content padded">
        <div class="row">
            <div class="col-lg-6">
                <div class="box">
                    <div class="box-header">
                        <div class="title">Order Header #: <em>@Model.OrderHeader.OrderHeaderNumber</em></div>
                    </div>
                    <div class="box-content padded">
                        <div class="row">
                            <div class="col-lg-12">
                                <form class="fill-up">
                                    <ul class="padded separate-sections">
                                        <li class="input"><label>Order Date</label>@Html.Kendo().DateTimePickerFor(x => x.OrderHeader.OrderDate).HtmlAttributes(new { @readonly = "readonly", placeholder = "Order Date" })</li>
                                        <li class="input"><label>Order State</label>@Html.TextBoxFor(x => x.OrderHeader.OrderState, new { @readonly = "readonly", placeholder = "Order State" })</li>
                                    </ul>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="box">
                    <div class="box-header">
                        <div class="title">Customer: <em>@Model.Customer.SimpleContact</em></div>
                    </div>
                    <div class="box-content padded">
                        <div class="row">
                            <div class="col-lg-12">
                                <form class="fill-up">
                                    <ul class="padded separate-sections">
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.Title, new { @readonly = "readonly", placeholder = "title" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.FirstName, new { @readonly = "readonly", placeholder = "first name" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.MiddleName, new { @readonly = "readonly", placeholder = "middle name" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.LastName, new { @readonly = "readonly", placeholder = "last name" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.PhoneNumber, new { @readonly = "readonly", placeholder = "phone number" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.CellNumber, new { @readonly = "readonly", placeholder = "cell number" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.FaxNumber, new { @readonly = "readonly", placeholder = "fax number" })</li>
                                        <li class="input">@Html.TextBoxFor(x => x.Customer.Person.Contact.EmailAddress, new { @readonly = "readonly", placeholder = "email address" })</li>
                                    </ul>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="box">
    <div class="box-header">
        <div class="title">Orders</div>
        <ul class="box-toolbar">
            <li><span class="label label-green">@Model.Orders.Count()</span></li>
        </ul>
    </div>
    <div class="box-content padded">
        @for(int i = 0; i < Model.Orders.Count(); i++)
        {
            <div class="row">
                <div class="col-lg-12">
                    <form class="fill-up">
                        <ul class="padded separate-sections">
                            <li class="input"><label for="OrderDate">Order Number</label>@Html.TextBoxFor(x => x.Orders.ElementAt(i).OrderNumber, new { @readonly = "readonly", placeholder = "Order State" })</li>
                            <li class="input"><label for="OrderDate">Order Type</label>@Html.TextBoxFor(x => x.Orders.ElementAt(i).OrderType, new { @readonly = "readonly", placeholder = "Order Type" })</li>
                            <li class="input">
                                <label>Products</label>
                                <table id="product-table" class="table table-normal" style="width:100%">
                                    <thead>
                                        <tr>
                                            <td>ID</td>
                                            <td>Name</td>
                                            <td>Quantity</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach (var product in Model.Orders.ElementAt(i).Products)
                                        {
                                            <tr>
                                                <td>@product.ProductID</td>
                                                <td>@product.ProductName</td>
                                                <td>@product.Quantity</td>
                                            </tr>
                                        }
                                        <tr>
                                            <td>Sub Total</td>
                                            <td colspan="2">@Model.Orders.ElementAt(i).SubTotal</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </li>
                        </ul>
                    </form>
                </div>
            </div>
        }
    </div>
</div>

